<?php

namespace  App\Http\Controllers\V1;

use App\Helpers\RestResponseFactory;
use App\Helpers\RestUtils;
use App\Http\Controllers\Controller;
use App\Models\Factory\SmsFactory;
use App\Models\Factory\UserFactory;
use App\Models\Orm\Banner;
use App\Models\Orm\UserApply;
use App\Services\Core\Sms\Dahan\DahanService;
use Illuminate\Http\Request;
/**
 * Class GeetesController
 * @package App\Http\Controllers\V1
 * 短信
 */
class ApplyController extends  Controller
{

    /**
     * 发送短信
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function apply(Request $request)
    {
        $user = $request -> get('user');
        $data = $request->except('token');
        $data['user_id'] = $user ->id;
        $data['created_at'] =date('Y-m-d H:i:s',time());
        $data = UserApply::updateOrCreate(['user_id'=>$data['user_id']],$data);
        return RestResponseFactory::ok(RestUtils::getStdObj(),200);

    }




}